package cn.me.alphamq.broker.core.commitlog;

import java.util.HashMap;
import java.util.Map;

/**
 * 管理 CommitLog 的 MMap 文件的模型
 *
 * @author f
 */
public class CommitLogMMapFileModelManager {

    /**
     * key: topic 名称，value: CommitLog 文件的 MMap 对象
     */
    private static final Map<String, CommitLogMMapFileModel> mMapFileModelMap = new HashMap<>();

    public void put(String topic, CommitLogMMapFileModel commitLogMMapFileModel) {
        mMapFileModelMap.put(topic, commitLogMMapFileModel);
    }

    public CommitLogMMapFileModel get(String topic) {
        return mMapFileModelMap.get(topic);
    }

}
